home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / HAMRADIO / WEFAX.ZIP / MAGSEE.ASM < prev    next >
Assembly Source File  |  1984-05-19  |  4KB  |  166 lines

  1. title        MAGSEE.ASM ;derived from SEE_IT.ASM for use in
  2. ;              MAGNIFY.BAS
  3.  
  4. ;        by: e. w. schwittek   revised 5/18/84
  5.  
  6. page ,132
  7.  
  8. data         segment
  9. init_es        dw 0 ;initial value of es for data fm SEE_IT.BAS
  10. lines        db 0 ;nr of lines of graphics per seg of data
  11. init_si        dw 0 ;value of init setting of si fm SEE_IT.BAS
  12. samperbyte    dw 0 ;nr of data samples per data byte fm SEE_IT.BAS
  13. skip        dw 0 ;nr of bytes skipped after each graphic line
  14. count_sample    dw ? ;samples/data byte
  15. count_line    db ? ;nr of lines per segment of data
  16. fullbyte    db 0 ;sample collection byte
  17. counter        db 0
  18. holdcount    db 0
  19. count_80    db 80 ;bytes per graphic display line
  20. count_200    db 200 ;lines per picture
  21. counter200    db 0 ;to be set by count_200
  22. data        ends
  23.  
  24. code        segment
  25. start        proc far
  26.         assume ds:data,cs:code
  27.  
  28. ;this gets init_si,samperbyte,and init_es fm SEE_IT.BAS
  29.         push bp ;save bp
  30.         mov bp,sp ;get current stack position into bp
  31.         mov si,[bp]+12 ;get addr of init_si into si
  32.         mov ax,[si] ;get value of init_si 
  33.         push ax ;put init_si on stack for storage
  34.         mov si,[bp]+10 ;get addr of samperbyte into si
  35.         mov ax,[si] ;get value of samperbyte
  36.         push ax ;put samperbyte on stack for storage
  37.         mov si,[bp]+8 ;get addr of init_es into si
  38.         mov ax,[si] ;get value of init_es
  39.         push ax ;put init_es on stack for storage
  40.         mov si,[bp]+6 ;get addr of para O, offset
  41.         mov ax,[si] ;get value of O
  42.         push ax ;put O on stack for storage
  43.  
  44. ;establish addressability for data segment
  45.         mov ax,cs 
  46.         pop si ;put offset/16 in si
  47.         add ax,si
  48.         add ax,19 ;diff between cs & ds
  49.         mov ds,ax
  50.  
  51.  
  52.         pop init_es ;put init_es into data seg
  53.         pop samperbyte ;put samperbyte into data seg
  54.         pop init_si ;put init_si into data seg
  55.  
  56. ;initiate registers and counters
  57.         sub cx,cx
  58.         sub di,di
  59.         sub bx,bx
  60.         mov si,init_si
  61.  
  62.         cmp samperbyte,4
  63.         jz four
  64.         cmp samperbyte,2
  65.         jz two
  66.         cmp samperbyte,1
  67.         jmp one
  68. four:        mov skip,240
  69.         mov lines,200
  70.         mov cl,1
  71.         mov holdcount,1
  72.         jmp together
  73. two:        mov skip,480
  74.         mov lines,100
  75.         mov cl,3
  76.         mov holdcount,2
  77.         jmp together
  78. one:        mov skip,960
  79.         mov lines,50
  80.         mov cl,1
  81.         mov holdcount,4
  82. together:    mov ax,samperbyte
  83.         mov count_sample,ax
  84.  
  85.         mov al,holdcount
  86.         mov counter,al
  87.  
  88.         mov al,count_200
  89.         mov counter200,al
  90.  
  91.         mov al,lines
  92.         mov count_line,al
  93.  
  94. ;begin transfer of data from four segments to graphic memory
  95. begin:         mov ax,init_es
  96.         mov es,ax ;establish es register
  97.  
  98. ;get proper sample bits from data
  99. newbyte:    mov al,es:[si] ;data byte to al from x000:xxxx
  100. sample:        rcl al,cl ;rotate byte cl places left thru CF
  101.         rcl fullbyte,1 ;bit into fullbyte
  102.         rcl al,1 ;rotate another bit into CF
  103.         rcl fullbyte,1 ;another bit into fullbyte
  104.         dec count_sample ;nr of samples/data byte fm input_2
  105.         jnz sample
  106.         mov ax,samperbyte
  107.         mov count_sample,ax ;reset counter
  108.         inc si ;set si for next data byte
  109.         dec counter ;determine if fullbyte is full
  110.         jnz newbyte
  111.         mov al,holdcount
  112.         mov counter,al
  113.  
  114. ;put fullbyte into graphics memory
  115.         mov ax,0b800h
  116.         mov es,ax ;set es to 0b800h
  117.         mov al,fullbyte
  118.         mov es:[bx+di],al ;puts fullbyte in graphics memory
  119.         inc di ;set di for next fullbyte
  120.         dec count_80 ;creates line of 80 fullbytes
  121.         jnz begin
  122.         mov count_80,80 ;reset counter
  123.  
  124. ;determine which graphics mem area in use
  125.         sub bx,0000h
  126.         jnz upper ;upper area at b800:2000 in use
  127.  
  128. ;lower in use
  129.         mov bx,02000h ;change to upper graphics range
  130.         sub di,80 ;set di to beginning of next line
  131.         jmp joint
  132.  
  133. ;upper in use
  134. upper:        mov bx,0000h ;change to lower graphics range
  135.         add di,0 ;sets di to beginning of next line
  136.         jmp joint
  137.  
  138. ;following related to nr of lines of graphics completed
  139. ;and picture area selected in basic program
  140.  
  141. joint:        dec counter200 ;count total picture lines
  142.         jz finish
  143.         
  144.         add si,skip ;skip bytes and lines
  145.  
  146.         dec count_line ;determines data es change
  147.         jnz begin
  148.         mov al,lines
  149.         mov count_line,al
  150.         mov si,init_si ;reset si
  151.         add init_es,01000h ;advance es by 1000h
  152.         ;when next jump to begin occurs
  153.  
  154.         jmp begin
  155.  
  156. finish:        mov ax,ss
  157.         mov ds,ax ;restore ds
  158.         mov es,ax ;restore es
  159.  
  160.         pop bp ;restore stack
  161.         ret 8 ;far return to basic
  162. start        endp
  163. code        ends
  164.         end
  165.  
  166.